#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int n;
	int foot;
	int inch;
	scanf("%d", &n);
	foot = n / 30.48;
	inch = 12 * (n / 30.48 - foot);
	printf("%d %d", foot, inch);
	return 0;
}